package com.greatwideweb.runhelper;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener {

    Button btn=null;
    Button btn1=null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn = (Button) findViewById(R.id.button1);
        btn.setOnClickListener(this);
        btn1 = (Button) findViewById(R.id.button2);
        btn1.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    @Override
    public void onClick(View v) {
      // TODO Auto-generated method stub
      if(v == btn1) {
        
        Intent intent = new Intent(this, DataScreen.class);
        startActivityForResult(intent, 0);
        
      } else {
        
        Intent intent = new Intent(this, AddScreen.class);
        startActivityForResult(intent, 0);
      }
      
      
    }
}
